package com.qf.cqut.Service.impl;

import com.qf.cqut.Service.PlanService;
import com.qf.cqut.mapper.APlanMapper;
import com.qf.cqut.model.pojo.APlan;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class PlanServiceImpl implements PlanService {
    @Resource
    private APlanMapper aPlanMapper;

    @Override
    public List<APlan> selectByLimit(Integer page, Integer limit) {
        if(page != null && limit != null){
            page = (page - 1) * limit;
        }else{
            page = 0;
            limit = 10;
        }
        return aPlanMapper.selectByLimit(page,limit);
    }

    @Override
    public Integer count() {
        return aPlanMapper.count();
    }

    @Override
    public Integer delByIds(String[] ids) {

        return aPlanMapper.deleteByIds(ids);
    }

    @Override
    public Integer addAplan(APlan aPlan) {
        return aPlanMapper.addAplan(aPlan);
    }

    @Override
    public Integer editAplan(APlan aPlan) {
        return aPlanMapper.editAplan(aPlan);
    }

    @Override
    public List<APlan> queryByConditions(APlan aPlan) {
        return aPlanMapper.queryByConditions(aPlan);
    }
}
